package com;

import java.util.List;

import com.utils.ScannerUtils;

public class Player {

	private String name;
	private List<Card> cards;

	public Player() {
		super();
	}

	public Player(String name) {
		super();
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Card> getCards() {
		return cards;
	}

	public void setCards(List<Card> cards) {
		this.cards = cards;
	}

	public Card playCard() {
		System.out.println("Please play a card.\n");

		for (int i = 0; i < cards.size(); i++) {
			System.out.print(i + 1 + "\t");
		}
		System.out.println();

		for (Card card : cards) {
			System.out.print(card.getRank()
					+ card.getSuit().name().substring(0, 1).toUpperCase()
					+ "\t");
		}
		System.out.println("\n");

		int cardNumber = ScannerUtils.readFromKeyboard(cards.size());

		Card card = cards.get(cardNumber);
		cards.remove(cardNumber);

		return card;
	}

}
